package gui.std;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;

import javax.swing.JPanel;

@SuppressWarnings("serial")
public class GBackgroundedPanel extends JPanel {
	
	public GBackgroundedPanel(Image i) {
		img = i;
		setBackground(new Color(0xff, 0xff, 0xff, 0xff));
		setOpaque(false);
	}
	
	public void setImage(Image i) {
		img = i;
	}
	
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		Graphics2D _g = (Graphics2D)g;
		
		_g.drawImage(img, 0, 0, getWidth(), getHeight(), null);
	}
	
	private Image img;
}